# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-ipgetter
_pkgname=ipgetter2
pkgver=1.1.10
_pyver=3.13
pkgrel=6
pkgdesc='Utility to fetch your external IP address.'
url='https://pypi.org/project/ipgetter/#files'
arch=('any')
license=('Apache')
depends=('python' 'python-click' 'python-requests' 'python-chardet')
makedepends=('python-pip' 'python-build' 'python-wheel')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.zip"
	      'LICENSE')
sha512sums=('e13fd40fd02feaf3d3052f8d538851c67fb9700f52408bbabd67bba6b3ac4195f9b2ce4c2e0b32efc671b1a2712622c620bd4b122e9afdee91bb08f9e60e8e1b'
            '2c9e4db534550a6073d70ca09f44ffabab6a1c078e8663558ba8958dedd90f291ccd81b0a78e1dc21a5fd0cc9a1d2107a74e84ecdb23795b291326abd3d5c498')

build() {
  cd "$_pkgname-$pkgver"

  python -m build --wheel --outdir="$startdir/dist"
}

package() {
  cd "$_pkgname-$pkgver"

  pip install \
    --verbose \
    --disable-pip-version-check \
    --no-warn-script-location \
    --ignore-installed \
    --no-compile \
    --no-deps \
    --root="$pkgdir" \
    --prefix=/usr \
    --no-index \
    --find-links="file://$startdir/dist" \
    $_pkgname

  rm -rf "$pkgdir/usr/lib/python$_pyver/site-packages/tests"
}

